package ru.amse.tsyganov.jumleditor.properties;

import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;

public abstract class NoEmptyStringProperty extends Property<String> {

	public NoEmptyStringProperty(String name) {
		super(name);
	}

	@Override
	public CellEditor createCellEditor(Table table) {
		TextCellEditor textEditor = new TextCellEditor(table);
		((Text) textEditor.getControl()).addVerifyListener(
		
			new VerifyListener() {
				public void verifyText(VerifyEvent e) {
					//e.doit = e.text.matches("");
				}
			});
		return textEditor;
	}

}
